<?php


namespace Xiaoguai\DesignPattern\DP020;


class Singleton
{
    private static $instance;

    private function __construct(){}

    private function __clone(){}

    /**
     * @return Singleton
     */
    public static function getInstance(): Singleton
    {
        if (! self::$instance) {
            self::$instance = new Singleton();
        }
        return self::$instance;
    }
}